home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
bsrc_250.zip
/
B_SBINIT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-15
|
15KB
|
381 lines
/*--------------------------------------------------------------------------*/
/* */
/* */
/* ------------ Bit-Bucket Software, Co. */
/* \ 10001101 / Writers and Distributors of */
/* \ 011110 / Freely Available<tm> Software. */
/* \ 1011 / */
/* ------ */
/* */
/* (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
/* */
/* */
/* This module was originally written by Bob Hartman */
/* */
/* */
/* BinkleyTerm Initial Fullscreen Setup */
/* */
/* */
/* For complete details of the licensing restrictions, please refer */
/* to the License agreement, which is published in its entirety in */
/* the MAKEFILE and BT.C, and also contained in the file LICENSE.250. */
/* */
/* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
/* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
/* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
/* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT BIT BUCKET */
/* SOFTWARE CO. AT ONE OF THE ADDRESSES LISTED BELOW. IN NO EVENT */
/* SHOULD YOU PROCEED TO USE THIS FILE WITHOUT HAVING ACCEPTED THE */
/* TERMS OF THE BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER */
/* AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO. */
/* */
/* */
/* You can contact Bit Bucket Software Co. at any one of the following */
/* addresses: */
/* */
/* Bit Bucket Software Co. FidoNet 1:104/501, 1:343/491 */
/* P.O. Box 460398 AlterNet 7:491/0 */
/* Aurora, CO 80046 BBS-Net 86:2030/1 */
/* Internet f491.n343.z1.fidonet.org */
/* */
/* Please feel free to contact us at any time to share your comments about */
/* our software and/or licensing policies. */
/* */
/*--------------------------------------------------------------------------*/
/* Include this file before any other includes or defines! */
#include "includes.h"
#ifndef MILQ
#define WHOLEWIN
#endif
#ifdef MILQ
#define MENU_ENABLED
#if defined (MENU_ENABLED) || defined (MILQ)
#define RESOURCE_ENABLED
#endif
#endif
extern VIOMODEINFO vfos_mode;
void MilqMassageWnd( REGIONP Win, int Color );
#ifdef MILQ
int PASCAL color_enum( HWND hWnd,
DWORD lParam ) {
WinSetAttr( hWnd, (int)lParam, FALSE );
return TRUE;
}
HWND MilqDlgCreate( REGIONP Win,
char *Nm,
DLGPROC *dlgfunc,
int Color ) {
Win->hWnd = CreateDialog( MilqueRsrc, Nm, MilqueMailerWnd, dlgfunc );
MilqMassageWnd( Win, Color );
return Win->hWnd;
}
void MilqMassageWnd( REGIONP Win,
int Color ) {
int Bgd = WHITE;
HWND hMenu;
hMenu = GetSystemMenu( Win->hWnd, FALSE );
DeleteMenu( hMenu, SC_CLOSE, MF_BYCOMMAND );
AppendMenu( hMenu, MF_ENABLED, SC_SIZE, "~Size" );
GetWindowRect( Win->hWnd, &Win->MilqSave.OrgRect );
if ( !UseWinColors ) {
if ( Color ) {
WinSetAttr( Win->hWnd, Color, FALSE );
EnumChildWindows( Win->hWnd, color_enum, (long)Color );
} /* end of if ( Color ) */
} /* end of if ( !UseWinColors ) */
SetFocus( Win->hWnd );
}
#endif
void b_sbinit () {
#ifdef MILQ
char Buf[81];
#endif
register int r;
char *savep;
#ifdef MILQ
KbMapSet( &UnattendedKeyFncHdr );
WinInit();
MDIInitialize();
MilqueClassRegister();
WinUseSysColors (MilqueRootWnd, TRUE);
OrgVidInfo.VidMode = VidGetMode();
WinUseMonoMap( TRUE );
MilqueRsrc = OpenResourceFile((PSTR) PRDCT_PRFX);
/* Fetch the ega status and toggle if needed */
UseWinColors = GetPrivateProfileInt( "Milque", "UseWinColors", 0, "Milque.Ini" );
node_Pwd_Enable = GetPrivateProfileInt( "Milque", "PWD", 0, "Milque.Ini" );
#ifdef NEW_BIG_SCREEN
switch ( VidQueryAdapterType() ) {
case CGA:
case MDA:
break;
default:
if ( GetPrivateProfileInt( "Milque", "EGA", 0, "Milque.Ini" ) ) {
ToggleEGA();
MilqueVidInfo.EGAState = TRUE;
}
break;
}
#endif
if ( !( MilqueMailerAccel = LoadAccelerators( MilqueRsrc,
(LPSTR)"MailerAccel" ) ) ) {
MessageBox( MilqueRootWnd,
(PSTR)"Cannot load Mailer Accelerators",
(PSTR)"Fatal Error",
MB_OK );
exit(1);
}
MilqueActvAccel = MilqueMailerAccel;
if ( !( MilqueTrmnlAccel = LoadAccelerators( MilqueRsrc,
(LPSTR)"TrmnlAccel" ) ) ) {
MessageBox( MilqueRootWnd,
(PSTR)"Cannot load Terminal Accelerators",
(PSTR)"Fatal Error",
MB_OK );
exit(1);
}
if ( !( MilqueMailerMnu = LoadMenu( MilqueRsrc, (LPSTR)"MailerMenu" ) ) ) {
MessageBox( MilqueRootWnd,
(PSTR)"Cannot load the menu",
(PSTR)"Fatal Error",
MB_OK);
exit(1);
}
randomize();
MilqueMailerWnd = CreateWindow( (PSTR)"Normal", /* class */
(PSTR)"BTMewel", /* title */
WIN_HAS_BORDER |
WIN_MINMAXBOX |
WIN_MOVEBOX |
WIN_SIZEBOX |
WIN_SYSMENU |
WIN_TITLEBAR |
WS_CLIP |
WS_MAXIMIZEBOX |
WS_MINIMIZEBOX,
0,0, /* x,y,width,height */
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
MilqueRootWnd, /* hParent */
MilqueMailerMnu, /* hMenu */
0, /* hInst */
0L); /* lpParam */
MilqueActvWnd = MilqueMailerWnd;
WinSetWinProc( MilqueMailerWnd, MailerWndPrc );
#endif
savep = calloc (1, 4096);
for (r = 0; r < 132; r++)
{
blanks[r * 2] = ' ';